import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { environment } from '@env/environment';

// layout
import { LayoutDefaultComponent } from '../layout/default/default.component';
import { LayoutPassportComponent } from '../layout/passport/passport.component';

// 首页
import { DashboardV1Component } from './index/v1/v1.component';

// 用户登录引入
import { UserLoginComponent } from './passport/login/login.component';
import { UserRegisterComponent } from './passport/register/register.component';
import { UserRegisterResultComponent } from './passport/register-result/register-result.component';

// 异常页面
import { Exception403Component } from './exception/403.component';
import { Exception404Component } from './exception/404.component';
import { Exception500Component } from './exception/500.component';

// 提交清单页面
import { LaunchApplyComponent } from './listManagement/launch-apply/launch-apply.component';
import { SubListComponent } from './listManagement/sub-list/sub-list.component';
import { SProfilesComponent } from './listManagement/UnderlyingParameter/s-profiles/s-profiles.component';
import { AdRecordComponent} from './listManagement/ad-record/ad-record.component';
import { SProjectComponent } from './listManagement/UnderlyingParameter/s-project/s-project.component';
import { SWorkitemComponent } from './listManagement/UnderlyingParameter/s-workitem/s-workitem.component';
import { SBranchComponent } from './listManagement/UnderlyingParameter/s-branch/s-branch.component';
//回退申请
import { RevertListComponent } from './listManagement/revert-list/revert-list.component';
// 工作项360
import { OverviewComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/overview/overview.component';
import { WorklifeComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/worklife/worklife.component';
import { StandardlistComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/standardlist/standardlist.component';
import { StashlistComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/stashlist/stashlist.component';
import { WorkdetailComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/workdetail/workdetail.component';
import { DeliveryPlanComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/delivery-plan/delivery-plan.component';
import { DetailedComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/detailed/detailed.component';
import { RollbackComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/rollback/rollback.component';
import { DelaylistComponent } from './listManagement/UnderlyingParameter/s-workitem/workInfo/delaylist/delaylist.component';

//环境360
import { ProfileDetailComponent } from './listManagement/UnderlyingParameter/s-profiles/profilesInfo/profileDetail/profileDetail.component';
import { ProfilesOverviewComponent } from './listManagement/UnderlyingParameter/s-profiles/profilesInfo/profilesOverview/profilesOverview.component';
import { ProfilsWorkComponent } from './listManagement/UnderlyingParameter/s-profiles/profilesInfo/profilsWork/profilsWork.component';
import { DeliveryDayComponent } from './listManagement/UnderlyingParameter/s-profiles/profilesInfo/deliveryDay/deliveryDay.component';
// 历史版本
import { HistoryComponent } from './listManagement/history/history.component';

//谁也再改
import { WhoChangeComponent } from './listManagement/UnderlyingParameter/who-change/who-change.component';
//延期申请
import { DelayComponent } from './listManagement/delay/delay.component';
const routes: Routes = [
    {
        path: '',
        component: LayoutDefaultComponent,
        children: [
            { path: '', redirectTo: 'dashboard/v1', pathMatch: 'full' },
            { path: 'dashboard', redirectTo: 'dashboard/v1', pathMatch: 'full' },
            { path: 'dashboard/v1', component: DashboardV1Component },
            // 投放申请路由
            { path: 'subList', component: SubListComponent },
            { path: 'launchApply', component: LaunchApplyComponent },
            { path: 'revertList', component: RevertListComponent },
            { path: 'delay', component: DelayComponent },
            { path: 'sProfiles', component: SProfilesComponent },
            { path: 'adRecord', component: AdRecordComponent },
            { path: 'sProject', component: SProjectComponent },
            { path: 'sworkItem', component: SWorkitemComponent },
             { path: 'whoChange', component: WhoChangeComponent },
            { path: 'workView', component: OverviewComponent, data: { i18n: 'workView' , title: '工作项详情' }, children: [
                    // 子路由模块
                    { path: 'workLife/:id', component: WorklifeComponent, data: { i18n: 'workLife' , title: '工作项360' } },
                    { path: 'standardlist/:id', component: StandardlistComponent, data: { i18n: 'standardlist' , title: '工作项360' } },
                    { path: 'stashlist/:id', component: StashlistComponent, data: { i18n: 'stashlist' , title: '工作项360' } },
                    { path: 'rollback/:id', component: RollbackComponent, data: { i18n: 'rollback' , title: '工作项360' }},                  
                    { path: 'delaylist/:id', component: DelaylistComponent, data: { i18n: 'delaylist' , title: '工作项360' }},                                   
                    { path: 'workdetail/:id', component: WorkdetailComponent, data: { i18n: 'workdetail' , title: '工作项360' } },
                    { path: 'delivery/:id', component: DeliveryPlanComponent, data: { i18n: 'delivery' , title: '工作项360' }},
                    { path: 'detailed/:id', component: DetailedComponent, data: { i18n: 'detailed' , title: '工作项360' }},
               
                ]},
            { path: 'profilesView', component: ProfileDetailComponent, data: { i18n: 'profilesView' , title: '运行环境详情' }, children: [
                    // 子路由模块
                    { path: 'overview/:id', component: ProfilesOverviewComponent, data: { i18n: 'overview' , title: '环境360' } },
                    { path: 'Work/:id', component: ProfilsWorkComponent, data: { i18n: 'Work' , title: '环境360' } },
                    { path: 'deliveryDay/:id', component:  DeliveryDayComponent, data: { i18n: 'deliveryDay' , title: '环境360' } },
                    
              
                ]},
            { path: 'sBranch', component: SBranchComponent },
            { path: 'history', component: HistoryComponent },
        ]
    },
    // passport
    {
        path: 'passport',
        component: LayoutPassportComponent,
        children: [
            { path: 'login', component: UserLoginComponent },
            { path: 'register', component: UserRegisterComponent },
            { path: 'register-result', component: UserRegisterResultComponent }
        ]
    },

    // 单页不包裹Layout

    { path: '403', component: Exception403Component },
    // { path: '404', component: Exception404Component },
    { path: '500', component: Exception500Component },
    { path: '**', redirectTo: 'dashboard' },

];

@NgModule({
    imports: [RouterModule.forRoot(routes, { useHash: environment.useHash })],
    exports: [RouterModule]
})
export class RouteRoutingModule { }
